home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / bash / bash-108 / bash-108.zoo / src / Makefile.cross < prev    next >
Encoding:
Makefile  |  1991-08-30  |  6.0 KB  |  214 lines

  1.  
  2. # We would like you to use Bison instead of Yacc since some
  3. # versions of Yacc cannot handle reentrant parsing.  Unfortunately,
  4. # this includes the Yacc currently being shipped with SunOS4.x.
  5. # If you do use Yacc, please make sure that any bugs in parsing
  6. # are not really manifestations of Yacc bugs before you report
  7. # them.
  8.  
  9. # Here is a rule for making .o files from .c files that does not
  10. # force the type of the machine (like -"sparc") into the flags.
  11. .c.o:
  12.     $(RM) $@
  13.     $(CC) -c -o $*.o $(CFLAGS) $(CPPFLAGS) $*.c
  14.  
  15.  
  16.  
  17. BISON = bison -y
  18. CC    = cgcc
  19.  
  20. SHELL=bash
  21.  
  22. MACHINE = "atari"
  23. OS = TOS
  24.  
  25. PROFILE_FLAGS=
  26.  
  27. # This system has the setlinebuf () call.
  28. # LINEBUF = -DHAVE_SETLINEBUF
  29.  
  30. # This system has the vprintf () and vfprintf calls.
  31. VPRINTF = -DHAVE_VPRINTF
  32.  
  33. # This system has <unistd.h>.
  34. UNISTD = -DHAVE_UNISTD_H
  35.  
  36. # This system has multiple groups.
  37. # GROUPS = -DHAVE_MULTIPLE_GROUPS
  38.  
  39. # This system has <sys/resource.h>
  40. RESOURCE = -DHAVE_RESOURCE
  41.  
  42. # This system's signal () call returns a pointer to a function returning
  43. # void.  The signal handlers themselves are thus void functions.
  44. SIGHANDLER = -DVOID_SIGHANDLER
  45.  
  46. # This system has <sys/wait.h>
  47. # WAITH = -DHAVE_WAIT_H
  48.  
  49. # This system has the getwd () call.
  50. # GETWD = -DHAVE_GETWD
  51.  
  52. # This system has a working version of dup2 ().
  53. DUP2 = -DHAVE_DUP2
  54.  
  55. SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
  56.                $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) \
  57.             -D$(MACHINE) -D$(OS)
  58.  
  59. DEBUG_FLAGS  = $(PROFILE_FLAGS) # -g 
  60. LDFLAGS         = $(SYSDEP_LD) $(DEBUG_FLAGS)  -s 
  61.  
  62. CFLAGS         = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
  63.            -O -fstrength-reduce 
  64.  
  65. CPPFLAGS     = -I$(LIBSRC)
  66.  
  67. # These are required for sending bug reports.
  68. SYSTEM_NAME = $(MACHINE)
  69. OS_NAME     = $(OS)
  70.  
  71. # The name of this program.
  72. PROGRAM     = bash.ttp
  73.  
  74. # The type of machine Bash is being compiled on.
  75. HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)'
  76.  
  77. bash_maintainer = scott@sparc1.stevens-tech.edu
  78. MAINTAIN_DEFINE = -DMAINTAINER='"$(bash_maintainer)"'
  79.  
  80. # The group of configuration flags.  These are for shell.c
  81. CFG_FLAGS = -DOS_NAME='"$(OS_NAME)"' -DSYSTEM_NAME='$(SYSTEM_NAME)' \
  82.             $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
  83.  
  84. # The directory which contains the source for malloc.  The name must
  85. # end in a slash, as in "../alloc-files/".
  86. ALLOC_DIR = ../alloc-files/
  87.  
  88. # Our malloc.
  89. ALLOCA_H_DEFINE = -DHAVE_ALLOCA_H
  90. ALLOCA_DEFINE   = -DHAVE_ALLOCA
  91. ALLOCA_CFLAGS   = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
  92. ALLOC_HEADERS   = $(ALLOC_DIR)getpagesize.h
  93. ALLOC_FILES     = $(ALLOC_DIR)malloc.c $(ALLOC_DIR)alloca.c
  94.  
  95. RM = rm -f
  96.  
  97. # Support libraries required.  Termcap and Readline.
  98. # The location of sources for the support libraries.
  99. LIBSRC  = ../
  100. RLIBSRC = ../readline/
  101.  
  102. # You wish to compile with the line editing features installed.
  103. READLINE_LIB = -lreadline
  104. TERMCAP_LIB  = -ltermcap
  105.  
  106. # The source and object of the bash->readline interface code.
  107. RL_SUPPORT_SRC = bashline.c
  108. RL_SUPPORT_OBJ = bashline.o
  109.  
  110. # The order is important.  Most dependent first.
  111. LIBRARIES = $(READLINE_LIB) $(TERMCAP_LIB) $(LOCAL_LIBS) -liio
  112.  
  113. LIB_P     = ../lib+/lib-plus.c
  114. LIB_P_OBJ = ../lib+/lib-plus.o
  115.  
  116.  
  117. CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
  118.        dispose_cmd.c execute_cmd.c variables.c builtins.c\
  119.        fc.c expr.c copy_cmd.c flags.c subst.c glob.c hash.c mailcheck.c\
  120.        test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) braces.c\
  121.        unwind_prot.c siglist.c ulimit.c version.c $(RL_SUPPORT_SRC)\
  122.          $(LIB_P)
  123.  
  124.  
  125. HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c y.tab.h \
  126.        alias.h general.h variables.h config.h $(ALLOC_HEADERS) \
  127.        quit.h ndir.h machines.h posixstat.h
  128.  
  129. SOURCES     = $(CSOURCES) $(HSOURCES)
  130.  
  131. OBJECTS     = shell.o y.tab.o general.o make_cmd.o print_cmd.o\
  132.        dispose_cmd.o execute_cmd.o variables.o builtins.o copy_cmd.o\
  133.        fc.o expr.o flags.o jobs.o subst.o glob.o hash.o mailcheck.o test.o\
  134.        trap.o alias.o $(MALLOC) $(ALLOCA) braces.o unwind_prot.o\
  135.        $(SIGLIST) ulimit.o version.o $(RL_SUPPORT_OBJ) $(LIB_P_OBJ)
  136.  
  137. all: $(PROGRAM) 
  138.  
  139. $(PROGRAM):  .build $(OBJECTS) 
  140.     rm -f $@
  141.     $(CC) $(LDFLAGS) $(READLINE_LDFLAGS) -o $(PROGRAM) $(OBJECTS)\
  142.               $(LIBRARIES)
  143.  
  144. .build:    $(SOURCES) 
  145.     @echo
  146.     @echo "      ***************************************************"
  147.     @echo "      *                            *"
  148.     @echo "      * Making Bash for a $(MACHINE) running $(OS)."
  149.     @echo "      *                            *"
  150.     @echo "      ***************************************************"
  151.     @echo
  152.     @echo "$(PROGRAM) last made for a $(MACHINE) running $(OS)" >.machine
  153.  
  154. shell.h:    general.h variables.h config.h quit.h
  155.         touch shell.h
  156.  
  157. jobs.h:        endian.h quit.h
  158.         touch jobs.h
  159.  
  160. variables.h:    hash.h
  161.         touch variables.h
  162.  
  163. builtins.h:    alias.h
  164.         touch builtins.h
  165.  
  166. y.tab.c:    parse.y shell.h
  167.         $(BISON) -d parse.y
  168.  
  169. version.o:    version.h
  170.  
  171. shell.o:    shell.h flags.h shell.c posixstat.h
  172.         $(CC) $(CFG_FLAGS) $(CFLAGS) $(CPPFLAGS) -c shell.c
  173.  
  174. ulimit.o:    shell.h ulimit.c pipesize.h
  175.         $(CC) $(CFLAGS) -c ulimit.c
  176.  
  177. variables.o: shell.h hash.h flags.h
  178.     $(CC) -c $(CFLAGS) $(HOSTTYPE_DECL) variables.c
  179.  
  180. braces.o: general.h
  181. builtins.o: shell.h hash.h jobs.h builtins.h trap.h flags.h
  182. copy_cmd.o: shell.h hash.h
  183. dispose_cmd.o: shell.h
  184. execute_cmd.o: shell.h y.tab.h posixstat.h builtins.h flags.h jobs.h
  185. expr.o: shell.h hash.h
  186. fc.o: shell.h hash.h builtins.h
  187. flags.o: flags.h config.h general.h quit.h
  188. general.o: shell.h
  189. glob.o: config.h
  190. hash.o: shell.h hash.h
  191. jobs.o: shell.h hash.h trap.h jobs.h
  192. mailcheck.o: posixstat.h variables.h hash.h quit.h
  193. make_cmd.o: shell.h flags.h
  194. parse.o: shell.h flags.h
  195. print_cmd.o: shell.h y.tab.h
  196. shell.o: shell.h flags.h
  197. subst.o: shell.h flags.h alias.h jobs.h
  198. test.o: posixstat.h
  199. trap.o: trap.h shell.h hash.h
  200. ulimit.o: variables.h quit.h pipesize.h
  201. unwind_prot.o: config.h general.h
  202.  
  203. bashline.o: shell.h hash.h builtins.h
  204.  
  205. bashline.o: $(RLIBSRC)chardefs.h $(RLIBSRC)history.h $(RLIBSRC)readline.h
  206. bashline.o: $(RLIBSRC)keymaps.h $(RLIBSRC)history.h
  207. fc.o:        $(RLIBSRC)history.h
  208. parse.o:    $(RLIBSRC)keymaps.h $(RLIBSRC)chardefs.h $(RLIBSRC)history.h
  209. parse.o:    $(RLIBSRC)readline.h
  210. subst.o:    $(RLIBSRC)history.h
  211.  
  212. clean:
  213.         $(RM) $(OBJECTS) $(PROGRAM) 
  214.